﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs" Inherits="Whoever.Website.Site.Contact" %>
<%@ Register src="../UserControls/PanelSide.ascx" tagname="PanelSide" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderCentral" runat="server">
    <% if (false) { %><script type="text/javascript" src="../Scripts/jquery-1.7.1.min.js"></script><% } %>
<% if (false) { %><script type="text/javascript" src="../Scripts/SiteScript.js"></script><% } %>
<script type="text/javascript">

    $(document).ready(function () {
        AssignEventHandlers();
        LoadControls();
    }
    );

    function ClearForm() {
        $(".FormTextBox").val("");
    }

    function LoadControls() {
        $(".FormCheckFields").css("display", "none");
        if ($(".FormMessageSended").css("display") != "none") {
            $(".FormMessageSended").fadeOut(3000);
        }
    }

    function AssignEventHandlers() {
        $("[id$=TextBoxName]").keyup(function () { ObligatoryFieldMessage("[id$=TextBoxName]", "[id$=ObligatoryFieldName]"); });
        $("[id$=TextBoxEmail]").keyup(function () { ObligatoryEmailAddress("[id$=TextBoxEmail]", "[id$=ObligatoryFieldEmail]"); });
        $("[id$=TextBoxMessage]").keyup(function () { ObligatoryFieldMessage("[id$=TextBoxMessage]", "[id$=ObligatoryFieldMessage]"); });
        $("[id$=TextBoxName]").change(function () { ObligatoryFieldMessage("[id$=TextBoxName]", "[id$=ObligatoryFieldName]"); });
        $("[id$=TextBoxEmail]").change(function () { ObligatoryEmailAddress("[id$=TextBoxEmail]", "[id$=ObligatoryFieldEmail]"); });
        $("[id$=TextBoxMessage]").change(function () { ObligatoryFieldMessage("[id$=TextBoxMessage]", "[id$=ObligatoryFieldMessage]"); });
        $("[id$=ButtonSend]").click(function () { return ValidForm(); });
    }

    function ObligatoryFieldMessage(TextBox,ObligatoryField) {
        if (!ValueIsNull($(TextBox).val())) {
            $(ObligatoryField).fadeOut(500);
        }
        else {
            $(ObligatoryField).fadeIn(500);
        }
    }

//    function ObligatoryEmailAddress(TextBox, ObligatoryField) {
//        if (!ValueIsNull($(TextBox).val()) && ValueIsEmail($(TextBox).val())) {
//            $(ObligatoryField).fadeOut(500);
//        }
//        else {
//            $(ObligatoryField).fadeIn(500);
//        }
    //    }

    function ObligatoryEmailAddress(TextBox, ObligatoryField) {
            if (!ValueIsNull($(TextBox).val()) && ValueIsEmail($(TextBox).val())) {
                $(ObligatoryField).fadeOut(500);
            }
            else {
                $(ObligatoryField).fadeIn(500);
            }
        }

    function ValidNotNullField(TextBox) {
        if (!ValueIsNull($(TextBox).val())) {
            return true;
        }
        return false;
    }

    function ValidForm() {
        LoadControls();
        if (!ValueIsNull($("[id$=TextBoxName]").val()) && !ValueIsNull($("[id$=TextBoxEmail]").val()) && ValueIsEmail($("[id$=TextBoxEmail]").val()) && !ValueIsNull($("[id$=TextBoxMessage]").val())) {
            return true;
        }
        $(".FormCheckFields").fadeIn(500);
        return false;
    }

</script>

    
    <div class="ClearDiv" style=" height:640px;" align="left">

        <div class="FloatLeft" style=" height:640px; width:300px;">
            
            <uc1:PanelSide ID="PanelSideTopInfo" runat="server" Width="300" IsTop="true" />
            <div class="PanelContent" style=" height:230px; width:300px;">
                <div class="ClearDiv" align="left">
                    <p align="center" class="SiteStandardTextLarge" style="margin:0px 0px 0px 0px; padding:0px 0px 0px 0px;">Envianos tus necesidades</p>
                    <p class="SiteStandardTextMedium" style="margin:10px 10px 0px 10px;">
                    En el siguiente formulario podrás enviarnos un mensaje con tus consultas, dudas o necesidades.
                    <br />
                    Procura brindarnos una forma de contactarte de regreso ya sea por e-mail o teléfono
                    cualquíer duda o pedido será respondido a la brevedad.
                    <br />
                    <br />
                    <strong class="StandardColor">Who</strong>ever Systems.
                    </p>
                </div>
            </div>
            <uc1:PanelSide ID="PanelSideFootInfo" runat="server" Width="300" IsTop="false" />

            <uc1:PanelSide ID="PanelSideTopEmail" runat="server" Width="300" IsTop="true" />
            <div class="PanelContent" style=" height:130px; width:300px;">
                <div class="ClearDiv" align="left">
                    <p align="center" class="SiteStandardTextLarge" style="margin:0px 0px 0px 0px; padding:0px 0px 0px 0px;">Nuestra casilla de correo</p>
                    <p class="SiteStandardTextMedium" style="margin:10px 10px 0px 10px;">
                    Envianos un correo electrónico a la siguiente dirección:
                    <br />
                    <br />
                    <strong style=" border-bottom:1px solid #AAAAAA">Contact@<strong class="StandardColor">Who</strong>ever-Systems.com</strong>
                    </p>
                </div>
            </div>
            <uc1:PanelSide ID="PanelSideFootEmail" runat="server" Width="300" IsTop="false" />

        </div>

        <div class="FloatLeft" style=" height:640px; width:765px; margin:0px 0px 0px 30px;">
        
            <uc1:PanelSide ID="PanelSideTopMessage" runat="server" Width="765" IsTop="true" />
            <div class="PanelContent" style=" height:600px; width:765px;">
                <div class="ClearDiv" align="center">
                    <p class="SiteStandardTextxxLarge" style="margin:0px 0px 0px 0px; padding:0px 0px 0px 0px;">Formulario de contacto</p>
                </div>
                <div style="height:30px;"></div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="LabelName" CssClass="FormText" Text="Nombre:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxName" CssClass="FormTextBox" 
                        ViewStateMode="Disabled"></asp:TextBox>
                    <div ID="ObligatoryFieldName" class="FormObligatoryField" tooltip="campo obligatorio"></div>

                </div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="Label6" CssClass="FormText" Text="Apellido:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxSurname" CssClass="FormTextBox" 
                        ViewStateMode="Disabled"></asp:TextBox>
                </div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="Label2" CssClass="FormText" Text="E-Mail:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxEmail" CssClass="FormTextBox" 
                        ViewStateMode="Disabled"></asp:TextBox>
                    <div ID="ObligatoryFieldEmail" class="FormObligatoryField"></div>
                        
                </div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="Label3" CssClass="FormText" Text="Teléfono:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxPhone" CssClass="FormTextBox" 
                        ViewStateMode="Disabled"></asp:TextBox>
                </div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="Label4" CssClass="FormText" Text="Asunto:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxSubject" CssClass="FormTextBox" 
                        ViewStateMode="Disabled"></asp:TextBox>
                </div>
                <div class="FormDiv">
                    <asp:Label runat="server" ID="Label5" CssClass="FormText" Text="Mensaje:"></asp:Label>
                    <asp:TextBox runat="server" ID="TextBoxMessage" CssClass="FormTextBox" Height="200px" 
                        TextMode="MultiLine" ViewStateMode="Disabled"></asp:TextBox>
                    <div ID="ObligatoryFieldMessage" class="FormObligatoryField"></div>
                </div>
                <div class="FormDiv">
                    <div class="FloatLeft" style=" width:200px; height:60px;"></div>
                    <div class="FloatLeft" style=" width:300px; height:60px;">
                        <asp:Button runat="server" ID="ButtonSend" CssClass="FormButton" 
                        Text="Enviar" onclick="ButtonSend_Click" />
                    </div>
                    <div class="FormCheckFields" runat="server" id="CheckFields">
                        
                    </div>
                    <div class="FormMessageSended" runat="server" id="MessageSended">
                    
                    </div>
                </div>

            </div>
            <uc1:PanelSide ID="PanelSideFootMessage" runat="server" Width="765" IsTop="false" />

        </div>
        
            
    </div>   



</asp:Content>
